<script> 
 var arr=new Array(); 
 //单个数据写入数组
 for (var i=1;i<=4;i++) 
 { 
 arr.unshift(i); 
 } 
 document.write("<br>"); 
 //批量写入数组
 arr.unshift("a",3.14,"hello"); 
 var newarr=new Array(1,2,3,4,5); 
 //写入新数组
 arr.unshift(newarr); 
 document.write("全部数据如下:<br>"); 
 document.write(arr.join(",")); 
</script>
